﻿
-- =============================================
-- Author:		Naresh N Jamadagni
-- Create date: 21 May 2012
-- Description:	Delets all the processes for specified computer
-- =============================================
CREATE PROCEDURE [dbo].[AddProcessEntry]
(
			@ComputerId int,
			@ProcessId int,
			@Caption nvarchar(100),
			@Description nvarchar(1000),
			@CommandLine nvarchar(1000),
			@ExecutablePath nvarchar(500),
			@Name nvarchar(100),
			@ParentProcessId int,
			@KernelModeTime bigint,
			@PageFileUsage int,
			@Priority int,
			@ThreadCount int,
			@PrivatePageCount bigint,
			@UserModeTime bigint,
			@VirtualSize bigint,
			@CreationDate datetime
           
)
AS

BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
   INSERT INTO [dbo].[Process]
           ([ComputerId]
           ,[ProcessId]
           ,[Caption]
           ,[Description]
           ,[CommandLine]
           ,[ExecutablePath]
           ,[Name]
           ,[ParentProcessId]
           ,[KernelModeTime]
           ,[PageFileUsage]
           ,[Priority]
           ,[ThreadCount]
           ,[PrivatePageCount]
           ,[UserModeTime]
           ,[VirtualSize]
           ,[CreationDate])
     VALUES
           (@ComputerId,
			@ProcessId,
			@Caption,
			@Description,
			@CommandLine,
			@ExecutablePath,
			@Name,
			@ParentProcessId,
			@KernelModeTime,
			@PageFileUsage,
			@Priority,
			@ThreadCount,
			@PrivatePageCount,
			@UserModeTime,
			@VirtualSize,
			@CreationDate);
END


